const router=require('koa-router')()


const {getMessList} =require('../controller/mess')

router.prefix('/mess')



function handleRes(ctx,next,res){
    if(res.status===0){
      ctx.body=res
    }else{
      ctx.status=400
      ctx.body=res
    }
}


router.post('/create',async (ctx,next)=>{

})


router.get('/list',async (ctx,next)=>{
    const res=await getMessList(ctx.query)
    handleRes(ctx,next,res)
})

router.post('/delete',async (ctx,next)=>{

})


module.exports=router